import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;


public class MotorTest {

	Motor aMotor;

	@Before
	public void setUp() throws Exception {
		aMotor = new Motor("XX1", 100);
	}

	@Test
	public void initalized() {
		String serial = aMotor.getSerialNumber();
		assertTrue(serial.equals("XX1"));
		
		int maximumHours = aMotor.getMaximumHoursBeforeService();
		assertTrue(maximumHours == 100);
		
		int currentHours = aMotor.getCurrentHours();
		assertTrue(currentHours == 0);
	}
	
	@Test
	public void addingHoursIncrements() {
		aMotor.addHours(10);
		int hours = aMotor.getCurrentHours();
		assertTrue(hours == 10);
		
		aMotor.addHours(15);
		hours = aMotor.getCurrentHours();
		assertTrue(hours == 10 + 15);
		
		aMotor.addHours(20);
		hours = aMotor.getCurrentHours();
		assertTrue(hours == 10 + 15 + 20);
		
	}

}
